package design_pattern.decorator.test3;

/**
 * Created by WeiDingKuo on 2017/10/25 14:59
 */
public class Decorator implements Component {
    private Component component;

    public Decorator(Component component) {
        this.component = component;
    }

    @Override
    public void dosomething() {
        befor();
        this.component.dosomething();
        after();
    }

    private void befor() {
        System.out.println("decorator 2 befor");
    }

    private void after() {
        System.out.println("decorator 2 after");
    }
}
